<!-- added to the meta section for the collection. please enclose elements in dt/dd. @collection is defined here but @challenge may not be.  -->

<% zone = (@collection.challenge.time_zone || Time.zone.name) %>
<% if @collection.challenge.signup_open %>
  <dt><%= ts("Signup")%>:</dt>
  <dd><%= link_to ts("CURRENTLY OPEN"), new_collection_signup_path(@collection) %></dd>

  <dt><%= ts("Signup closes")%>:</dt>
  <dd class="datetime"><%= time_in_zone(@collection.challenge.signups_close_at, zone) %></dd>

<% elsif Time.now < @collection.challenge.signups_open_at %>

  <dt><%= ts("Signup opens")%>:</dt>
  <dd class="datetime"><%= time_in_zone(@collection.challenge.signups_open_at, zone) %></dd>

  <dt><%= ts("Signup closes")%>:</dt>
  <dd class="datetime"><%= time_in_zone(@collection.challenge.signups_close_at, zone) %></dd>

<% elsif Time.now < @collection.challenge.signups_close_at %>
  <dt><%= ts("Signup")%>:</dt>
  <dd><%= ts("SIGNUP PERIOD IS OVER")%></dd>
<% end %>

<dt><%= ts("Assignments due")%>:</dt>
<dd class="datetime"><%= time_in_zone(@collection.challenge.assignments_due_at, zone) %></dd>

<% if @collection.unrevealed? %>
  <dt><%= ts("Works revealed")%>:</dt>
  <dd class="datetime"><%= time_in_zone(@collection.challenge.works_reveal_at, zone) %></dd>
<% end %>

<% if @collection.anonymous? %>
  <dt><%= ts("Authors revealed")%>:</dt>
  <dd class="datetime"><%= time_in_zone(@collection.challenge.authors_reveal_at, zone) %></dd>
<% end %>

<dt><%= ts("Signed up") %>:</dt>
<dd>
  <% num_to_show = 20 # arbitrary number for how many names to list %>
  <%= signup_count = @collection.signups.count %>
  <ul>
    <% @collection.signups.collect(&:pseud).compact.each_with_index do |pseud, index| %>
      <% if index == num_to_show %>
        </ul>
        <h5 id="show_signups" onclick="$('more_signups').show(); $('hide_signups').show(); this.hide()">(See all...)</h5>
        <ul id="more_signups" class="hideme">
      <% end %>
      <li><%= "#{pseud.byline}" + (index != (num_to_show-1) && index != (signup_count-1) ? "," : "") %></li>
    <% end %>
  </ul>
  <% if signup_count > num_to_show %>
    <h5 style="display:none" id="hide_signups" onclick="$('more_signups').hide(); $('show_signups').show(); this.hide()">(See fewer...)</h5>
  <% end %>
</dd>
